<template>
  <div class="home">
    <van-swipe :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="item in images" :key="item">
        <img :src="item" class="swipe_img">
      </van-swipe-item>
    </van-swipe>
    <div class="tip_list">已有{{number}}人获得房资深认证</div>
    <div class="title flex_space">
      <div class="mix_title"></div>
      <div class="flex_start">
        <span class="min_font">更多</span>
        <van-icon name="arrow" size="15"></van-icon>
      </div>
    </div>
    <div class="panel-list" v-for="item in  list " :key="item.id">
      <div class="card_header">
        <div class="flex_start">
          <img :src="item.img">
          <div class="img_left">
            <div class="flex_space">
              <div class="img_title">{{item.name}}</div>
              <div class="img_title">已有{{item.totalAll}}人关注</div>
            </div>
            <van-tag plain size="15px">{{item.tag}}</van-tag>
          </div>
        </div>
        <div class="button" @click="clickNuu()">
          <van-icon name="plus" size="13px" color="red"/>
          <span>关注</span>
        </div>
      </div>
      <div class="content">{{item.content}}</div>
    </div>
    <div class="all">
      查看全部房资深
      <van-icon name="arrow-down" size="15"></van-icon>
    </div>

    <div class="ertification" @click="ertification">认证</div>
  </div>
</template>
<script>
import {
  Tabbar,
  TabbarItem,
  Tag,
  Swipe,
  SwipeItem,
  Search,
  Icon,
  Lazyload,
  Button
} from 'vant'

export default {
  components: {
    [Tabbar.name]: Tabbar,
    [TabbarItem.name]: TabbarItem,
    [Swipe.name]: Swipe,
    [SwipeItem.name]: SwipeItem,
    [Tag.name]: Tag,
    [Icon.name]: Icon,
    [Search.name]: Search,
    [Lazyload.name]: Lazyload,
    [Button.name]: Button
  },
  data() {
    return {
      number: 111,
      images: [
        'https://img.yzcdn.cn/public_files/2017/10/24/e5a5a02309a41f9f5def56684808d9ae.jpeg',
        'https://img.yzcdn.cn/public_files/2017/10/24/1791ba14088f9c2be8c610d0a6cc0f93.jpeg'
      ],
      list: [
        {
          id: '0',
          title: '大多数人们喜欢的户型有哪些?',
          name: '@测试',
          img:
            'https://gss1.bdstatic.com/9vo3dSag_xI4khGkpoWK1HF6hhy/baike/w%3D790/sign=1cf755a396ef76c6d0d2f922ad17fdf6/b03533fa828ba61e51f94fad4734970a304e5919.jpg',
          totalAll: 666,
          tag: '房市资深顾问',
          content:
            '房价（房地产价格）是指建筑物连同其占用土地在特定时间段内房产的市场价值，即房价：土地价格+建筑物价格，是房地产经济运行和资源配置最重要的调节机制。房价的价格定位由多种因素构成。'
        },
        {
          id: '1',
          title: '学区房到底有什么好处?',
          name: '@张某某',
          img:
            'https://gss1.bdstatic.com/9vo3dSag_xI4khGkpoWK1HF6hhy/baike/w%3D790/sign=1cf755a396ef76c6d0d2f922ad17fdf6/b03533fa828ba61e51f94fad4734970a304e5919.jpg',
          totalAll: 999,
          tag: '风水师',
          content:
            '风水学，传统五术之一相术中的相地之术，本为相地之术，即临场校察地理的方法，叫地相、中国古代称堪舆术，目的是用来选择宫殿、村落选址、墓地建设等方法及原则，选择合适的地方的一门学问。属于一种自然科学'
        },
        {
          id: '2',
          title: '下一个学区房在哪里?',
          name: '@大磊',
          img:
            'http://cache.soso.com/wenwen/deploy/css/ued/wenwen/pc/dist/img/default-thumb/default-thumb7_1ae9802.png',

          totalAll: 999,
          tag: '开发商',
          content: 'jdhfkjhgfkjhvgrjvfhefrbh'
        }
      ]
    }
  },
  methods: {
    onSearch() {},
    ertification() {
      this.$router.push({
        path: '/applyfor'
      })
    }
  }
}
</script>
<style lang="less" scoped>
.home {
  position: relative;
  .swipe_img {
    width: 100%;
    height: 180px;
  }
  .tip_list {
    padding: 10px 10px;
    box-sizing: border-box;
    background-color: #fff;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
  }
  .title {
    padding: 10px 10px;
    box-sizing: border-box;
    .min_title {
      font-size: 14px;
    }
    .min_font {
      font-size: 12px;
    }
  }
  .panel-list {
    padding: 10px 10px;
    box-sizing: border-box;
    background-color: #fff;
    border-bottom: 1px solid #e5e5e5;
    .card_header {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      img {
        width: 30px;
        height: 30px;
        border-radius: 50%;
      }
      .img_title {
        font-size: 14px;
        margin-right: 10px;
      }
      .img_left {
        margin-left: 5px;
      }
    }
    .button {
      padding: 3px 5px;
      box-sizing: border-box;
      width: 60px;
      height: 30px;
      border-radius: 5px;
      border: 1px solid #e5e5e5;
      cursor: pointer;
      span {
        display: inline-block;
        font-size: 14px;
        color: #e5e5e5;
      }
    }
    .content {
      font-size: 13px;
      text-indent: 25px;
      margin-top: 5px;
    }
  }
  .all {
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 13px;
  }
  .ertification {
    position: fixed;
    bottom: 80px;
    right: 10px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid red;
    background-color: #fff;
    line-height: 50px;
    font-size: 12px;
    text-align: center;
    color: red;
    cursor: pointer;
  }
}
.flex_space {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
.flex_start {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
}

.min-size {
  font-size: 12px;
  color: #e3e3e3;
  margin-top: 10px;
}
</style>
